package com.leaptocloud.easycloud.demo;
/*
 * Copyright (C), 2017, 上海云首信息科技有限公司
 *
 * Author: 邓哲航
 * Date: 2018/5/13 下午5:50
 * History:
 * <author>    <time>    <version>    <desc>
 *
 */

import com.leaptocloud.easycloud.demo.exceptionmapper.AuthExceptionMapper;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.server.spring.scope.RequestContextFilter;
import com.leaptocloud.easycloud.demo.filter.KeystoneAuthFilter;

/**
 * @author 邓哲航
 * @see
 * @since 2.3.8
 */
public class Application extends ResourceConfig {

    /**
     * Register JAX-RS application components.
     */
    public Application() {

        // register application resources
        packages("com.leaptocloud.easycloud.demo.resource");
        // register filters
        register(RequestContextFilter.class);
        register(KeystoneAuthFilter.class);
        register(AuthExceptionMapper.class);
//        register(CORSResponseFilter.class);
//
//        // register exception mappers
//        register(GenericExceptionMapper.class);
//        register(AppExceptionMapper.class);
//        register(NotFoundExceptionMapper.class);
//
//        // register features
//        register(JacksonFeature.class);
//        register(MultiPartFeature.class);
    }
}
